package com.my.study.scheduler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling
@Slf4j
@ConditionalOnProperty(prefix = "scheduler",name = "enable",havingValue = "true")
public class DataHandlerScheduler {

    //@Scheduled(cron = "*/6 * * * * ?")
    @Scheduled(fixedDelay = 6000)
    private void process() {
        int count = 0;
        log.info("this is scheduler task runing  " + (count));
        count++;
    }
}
